#include <fstream>
#include <iostream>
#include <vector>
#include <cstdio>

#define LOCAL_DEBUG 1

#if LOCAL_DEBUG
char input_file[] = "data.in";
#define INPUT in
#else
#define INPUT cin
#endif // LOCAL_DEBUG

using namespace std;

///////////////////////////////////////////////////////////
// Sample Input Data:
// 4 1 4 2 3
// 5 1 4 2 -1 6
///////////////////////////////////////////////////////////

typedef vector<bool> bool_array;

const char* jolly = "Jolly";
const char* non_jolly = "Not jolly";

int main(void)
{
    unsigned int n;

#if LOCAL_DEBUG
    ifstream in(input_file);
#endif // LOCAL_DEBUG

    while((INPUT>>n) && !INPUT.eof())
    {
        bool is_jolly = true;
        
//        if (n > 1)
//        {
            int a;
            bool_array abs_stat_array(n, false);
            
            INPUT>>a;
            
            for(unsigned int i = 1; i < n; i++)
            {
                int b;
                
                INPUT>>b;

                unsigned int diff_abs;

                diff_abs = (a > b)?(a - b):(b - a);
                
                if (diff_abs > 0 && diff_abs < n)
                {
                    abs_stat_array[diff_abs] = 1;
                }
                
                a = b;
            }
            
            for(unsigned int j = 1; j < n; j++)
            {
                if (!abs_stat_array[j])
                {
                    is_jolly = false;
                    break;
                }               
            }            
//        }
        
        cout<<(is_jolly?jolly:non_jolly)<<endl;        
    }
    
    return 0;
}
